<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>MSc Dissertation: lwr.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">MSc Dissertation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">lwr.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="lwr_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#ifndef LWR_H</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define LWR_H</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;selforg/matrix.h&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">using namespace </span>matrix;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="code" href="classLWR.html">   23</a></span>&#160;<span class="keyword">class </span><a class="code" href="classLWR.html">LWR</a> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <a class="code" href="classLWR.html">LWR</a>(<span class="keywordtype">int</span> numSensors, <span class="keywordtype">int</span> numMotors);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classLWR.html">LWR</a>();</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordtype">void</span> setState(Matrix motors);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    </div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keywordtype">void</span> setDesiredOut(Matrix sensors);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    Matrix predict();</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    Matrix getModelMatrix();</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordtype">void</span> addToMemory(Matrix instance,Matrix desiredOut);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keywordtype">void</span> findWeights();</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keywordtype">void</span> weightData();</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordtype">void</span> findRegressionCoefficieents();</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">double</span> euclideanDistance(Matrix vector1,Matrix vector2);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="classLWR.html#a0ca0d792f6a4dd569fa1ef9c5444e17f">  103</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classLWR.html#a0ca0d792f6a4dd569fa1ef9c5444e17f">inputNum</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="classLWR.html#a2d6394b9ef3712d0e5fe6cedbee023b0">  104</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classLWR.html#a2d6394b9ef3712d0e5fe6cedbee023b0">outputNum</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    </div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="classLWR.html#a3b27e56c511b0590541189646beca69c">  106</a></span>&#160;    Matrix <a class="code" href="classLWR.html#a3b27e56c511b0590541189646beca69c">weights</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="classLWR.html#a1e3e278ef9540100c9cd14fa8e5eec64">  107</a></span>&#160;    Matrix <a class="code" href="classLWR.html#a1e3e278ef9540100c9cd14fa8e5eec64">regressionCoeff</a>;</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="classLWR.html#a1f9ee94677cb24599b3ee29e17f778fa">  108</a></span>&#160;    Matrix <a class="code" href="classLWR.html#a1f9ee94677cb24599b3ee29e17f778fa">inputHistory</a>;</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="classLWR.html#a5c01ae8d25bf4eb9a70241e3b262ea25">  109</a></span>&#160;    Matrix <a class="code" href="classLWR.html#a5c01ae8d25bf4eb9a70241e3b262ea25">outputHistory</a>;</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="classLWR.html#a1f10b43c5c2a8193a6a9a608ba1b4b25">  110</a></span>&#160;    Matrix <a class="code" href="classLWR.html#a1f10b43c5c2a8193a6a9a608ba1b4b25">currentInput</a>; </div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="classLWR.html#ac00e856f9ef407f234cb3f06fe534d65">  111</a></span>&#160;    Matrix <a class="code" href="classLWR.html#ac00e856f9ef407f234cb3f06fe534d65">desiredOutput</a>;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="classLWR.html#a8420c1052435c46cbd10c16ccf1ad485">  112</a></span>&#160;    Matrix <a class="code" href="classLWR.html#a8420c1052435c46cbd10c16ccf1ad485">weightedInputs</a>; </div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="classLWR.html#afc99ad32e2d3095addf80ae231548ce9">  113</a></span>&#160;    Matrix <a class="code" href="classLWR.html#afc99ad32e2d3095addf80ae231548ce9">weightedOutputs</a>; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;};</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">#endif  </span><span class="comment">/* LWR_H */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Aug 14 2013 17:48:49 for MSc Dissertation by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
